<?php
@require_once("config.php");
$paixu=$_GET["paixu"];
if($paixu){
    $str="select * from newinfo  order by price $paixu limit 0,8";
}else{
    $str="select * from newinfo limit 0,8";
}
// echo json_encode($str);
$result=mysql_query($str);

$list=array();
while($item=mysql_fetch_array($result)){
    $temp=array();
    $temp["id"]=$item["id"];
    $temp["goodsname"]=$item["goodsname"];
    $temp["price"]=$item["price"];
    $temp["smallimg"]=$item["smallimg"];
    $list[]=$temp;
}

echo json_encode($list);

?>